local threadName = redis.call('get',KEYS[1])
if(threadName == false) then
    return "1"
end
if(threadName == ARGV[1]) then
    return tostring(redis.call('del',KEYS[1]))
else
    return "0"
end